{extend name="layout/base" /}

{block name="style"}
<style type="text/css">
    .profile-avatar-container{position:relative;width:100px;margin:0 auto}
    .profile-avatar-container .profile-user-img{width:100px;height:100px}
    .profile-avatar-container .profile-avatar-text{display:none}
    .profile-avatar-container:hover .profile-avatar-text{display:block;position:absolute;height:100px;width:100px;background:#444;opacity:.6;color:#fff;top:0;left:0;line-height:100px;text-align:center}
    .profile-avatar-container button{position:absolute;top:0;left:0;width:100px;height:100px;opacity:0}

</style>
{/block}

{block name="body"}
<div class="wrapper wrapper-content">

<div class="row animated fadeIn">
    <div class="col-xs-5">
        <div class="ibox box-success">
            <div class="ibox-title">
                <h5>个人资料</h5>
            </div>
            <div class="panel-body ibox-content">

                <form id="update-form" role="form" data-toggle="validator" method="POST" action="{:Url('profile/update')}">
                    {:token()}
                    <input type="hidden" id="c-avatar" name="row[avatar]" value="{$admin.avatar|htmlentities}"/>
                    <div class="box-body box-profile">

                        <div class="profile-avatar-container">
                            <img class="profile-user-img img-responsive img-circle plupload" src="__CDN__/assets/admin/img/avatar.png" alt="" />
                            <!--<div class="profile-avatar-text img-circle">{:__('Click to edit')}</div>
                            <button id="plupload-avatar" class="plupload" data-input-id="c-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button>-->
                        </div>

                        <h3 class="profile-username text-center">{$admin.username|htmlentities}</h3>

                        <p class="text-muted text-center">{$admin.email|htmlentities}</p>
                        <div class="form-group">
                            用户名:
                            <input type="text" class="form-control" id="username" name="row[username]" value="{$admin.username|htmlentities}" disabled/>
                        </div>
                        <div class="form-group">
                            Email:
                            <input type="text" class="form-control" id="email" name="row[email]" value="{$admin.email|htmlentities}" data-rule="required;email"/>
                        </div>
                        <div class="form-group">
                            昵称:
                            <input type="text" class="form-control" id="nickname" name="row[nickname]" value="{$admin.nickname|htmlentities}" data-rule="required"/>
                        </div>
                        <div class="form-group">
                            密码:
                            <input type="password" class="form-control" id="password" placeholder="不修改密码请留空" autocomplete="new-password" name="row[password]" value="" data-rule="password"/>
                        </div>
                        <div class="form-group">
                            <button type="submit" class="btn btn-success">提交</button>
                            <button type="reset" class="btn btn-default">重置</button>
                        </div>

                    </div>
                </form>
            </div>
        </div>

    </div>
    <div class="col-md-7">

    </div>
</div>

</div><!--wrapper-->
{/block}